from llmchat.service.chat.ChatOpenAIService import ChatOpenAIService


class Factory:

    @classmethod
    def create_chat(
            cls,
            api_type: str = "openai",
            api_base: str = "",
            api_key: str = "",
    ):
        if api_type in ["openai"]:
            return ChatOpenAIService(
                api_type=api_type,
                api_base=api_base,
                api_key=api_key
            )
        else:
            raise ValueError("Invalid api type")
